package com.haizhi.bean;

// Generated 2016-8-15 17:44:37 by Hibernate Tools 3.2.2.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity: 
 */
@Entity
@Table(name = "tb_user_message", catalog = "db_lemon3d")
public class TbUserMessage implements java.io.Serializable {

	/** 
	 * ˽��ID.
	 */

	private Integer messageId;

	/** 
	 * ������ID.
	 */

	private TbUser tbUserByReceiveUserId;

	/** 
	 * ������ID.
	 */

	private TbUser tbUserByPostUserId;

	/** 
	 * ˽������.
	 */

	private String messageContent;

	/** 
	 * ����ʱ��.
	 */

	private Date messageTime;

	public TbUserMessage() {
	}

	public TbUserMessage(TbUser tbUserByReceiveUserId,
			TbUser tbUserByPostUserId, String messageContent, Date messageTime) {
		setTbUserByReceiveUserId(tbUserByReceiveUserId);
		setTbUserByPostUserId(tbUserByPostUserId);
		setMessageContent(messageContent);
		setMessageTime(messageTime);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "message_id", unique = true, nullable = false)
	public Integer getMessageId() {
		return this.messageId;
	}

	public void setMessageId(Integer messageId) {
		this.messageId = messageId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "receive_user_id", nullable = false)
	public TbUser getTbUserByReceiveUserId() {
		return this.tbUserByReceiveUserId;
	}

	public void setTbUserByReceiveUserId(TbUser tbUserByReceiveUserId) {
		this.tbUserByReceiveUserId = tbUserByReceiveUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "post_user_id", nullable = false)
	public TbUser getTbUserByPostUserId() {
		return this.tbUserByPostUserId;
	}

	public void setTbUserByPostUserId(TbUser tbUserByPostUserId) {
		this.tbUserByPostUserId = tbUserByPostUserId;
	}

	@Column(name = "message_content", nullable = false, length = 300)
	public String getMessageContent() {
		return this.messageContent;
	}

	public void setMessageContent(String messageContent) {
		this.messageContent = messageContent;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "message_time", nullable = false, length = 19)
	public Date getMessageTime() {
		return this.messageTime;
	}

	public void setMessageTime(Date messageTime) {
		this.messageTime = messageTime;
	}

}
